<!-- File: /app/View/Users/index.ctp -->

<h1>Blog posts</h1>
<div class="boton">
	<div class="boton_content">
		<p><?php echo $this->Html->link('Adicionar Usuário', array('action' => 'add')); ?></p>
	</div>
</div>
<table>
    <tr>
        <th>Id</th>
        <th>Title</th>
                <th>Actions</th>
        <th>Created</th>
    </tr>

<!-- Aqui é onde nós percorremos nossa matriz $posts, imprimindo
as informações dos posts -->
	
	<div id="post_background">
		<?php
                if($isAdmin=="admin")
                {
                    foreach ($users as $User):
			echo '<div class="post"><p>';
						echo '<p>Loguin: '.$this->Html->link($User['User']['username'], array('action' => 'view', $User['User']['id'])).'</p>';
						echo '<p>Tipo: '.$User['User']['role'].'</p>';
						echo '<p>NickName: '.$User['User']['nickname'].'</p>';
						echo '<p>E-mail: '.$User['User']['email'].'</p>';
                                                
                                                echo $this->Html->link($this->Html->image('icons/ico/modify.ico',
                                                    array("alt" => __('Edit'), "title" => __('Edit'),"width" => __('15'))), 
                                                    array('action' => 'edit', $User['User']['id']), 
                                                    array('escape' => false));
                                                echo $this->Form->postLink($this->Html->image('icons/ico/delete.ico',
                                                    array("alt" => __('Delete'), "title" => __('Delete'),"width" => __('15'))), 
                                                    array('action' => 'delete', $User['User']['id']),
                                                    array('escape' => false),
                                                    __('Você tem certeza?'));				
			echo '</p></div>';
		 endforeach;
                 }
                 ?>
	</div>

</table>